﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLNS_Public;
using System.Data;

namespace QLNS_Data
{
  public  class TimKiem_Data
    {
      KetNoiCSDL_Data kn = new KetNoiCSDL_Data();

      public DataTable TimKiem_MaNhanVien(NhanVien_Public maNV)
      {
          int n = 1;
          string[] name = new string[n];
          object[] value = new object[n];
          name[0] = "@MaNhanVien";
          value[0] = maNV.MaNhanVien;
          return kn.LayDuLieu("TimKiem_MaNhanVien",name,value,n);
      }
      public DataTable TimKiem_TenNhanVien(NhanVien_Public tenNV)
      {
          int n = 1;
          string[] name = new string[n];
          object[] value = new object[n];
          name[0] = "@TenNhanVien";
          value[0] = tenNV.HoTen;
          return kn.LayDuLieu("TimKiem_TenNhanVien", name, value, n);
      }
      public DataTable TimKiem_Luong_MaNhanVien(NhanVien_Public maNV, ChamCong_Public thang, ChamCong_Public nam)
      {
          int n = 3;
          string[] name = new string[n];
          object[] value = new object[n];
          name[0] = "@MaNhanVien";
          value[0] = maNV.MaNhanVien;
          name[1] = "@Thang";
          value[1] = thang.Thang;
          name[2] = "@Nam";
          value[2] = nam.Nam;
          return kn.LayDuLieu("TimKiem_Luong_MaNhanVien",name,value,n);
      }
      public DataTable TimKiem_Luong_TenNhanVien(NhanVien_Public tenNV, ChamCong_Public thang, ChamCong_Public nam)
      {
          int n = 3;
          string[] name = new string[n];
          object[] value = new object[n];
          name[0] = "@TenNhanVien";
          value[0] = tenNV.HoTen;
          name[1] = "@Thang";
          value[1] = thang.Thang;
          name[2] = "@Nam";
          value[2] = nam.Nam;
          return kn.LayDuLieu("TimKiem_Luong_TenNhanVien", name, value, n);
      }
      public DataTable TimKiem_PhongBan(PhongBan_Public tenPhong)
      {
          int n = 1;
          string[] name = new string[n];
          object[] value = new object[n];
          name[0] = "@TenPhong";
          value[0] = tenPhong.TenPhong;
          return kn.LayDuLieu("TimKiem_PhongBan", name, value, n);
      }
    }
}
